#![feature(string_remove_matches)]

pub mod config;
pub mod history;
pub mod kenerl;
pub mod role;
pub mod tool_sig;


#[cfg(test)]
mod tests {
    use talktive::{Message, TalkTive, TalkTiveBuilder, TalkTiveConfig};

    use self::kenerl::ChatGLMCpp;

    use super::*;

    #[tokio::test]
    async fn it_works() -> anyhow::Result<()> {
        let model = TalkTiveBuilder::<ChatGLMCpp>::new_load_kenerl_config("./chatglm.cpp.config.yaml", TalkTiveConfig::default())?;
        let mut model = model.build();
        let res = model.generate(Message::from_parts(role::Role::User, "hello".into())).await.unwrap();
        println!("{:?}",res);
        Ok(())
    }
}
